package calao.client;

import com.google.gwt.user.client.rpc.RemoteService;

public interface MemberService
extends RemoteService 
{

	static Permission ADMIN_MEMBERS = new Permission("calao.AdminMembers");

	/** Lists workspace members.
	 * This method returns an array of MemberInfo objects with the following attributes
	 * set: guid, email, name, profiles. 
	 */
	MemberInfo[] listMembers()
	throws NotConnectedException;

	/** Creates a member.
	 * <p>Requires permission {@link #ADMIN_MEMBERS}.  
	 */
	MemberInfo create(MemberInfo info)
	throws NotConnectedException, MissingPermissionException;
	
	/** Gets full details of a workspace member.
	 * <p>Requires permission {@link #ADMIN_MEMBERS}.  
	 */
	MemberInfo detailMember(long id)
	throws NotConnectedException, MissingPermissionException;

	/** Modifies member information.
	 * <p>Requires permission {@link #ADMIN_MEMBERS}.  
	 */
	void modify(MemberInfo info)
	throws NotConnectedException, MissingPermissionException;
	
	/** Lists member profiles.
	 */
	ProfileInfo[] listProfiles()
	throws NotConnectedException, MissingPermissionException;
	
	/** Saves member profiles.
	 * <p>Requires permission {@link #ADMIN_MEMBERS}.  
	 */
	void save(ProfileInfo profile)
	throws NotConnectedException, MissingPermissionException;

	/** Deletes member profiles.
	 * <p>Requires permission {@link #ADMIN_MEMBERS}.  
	 */
	void delete(ProfileInfo profile)
	throws NotConnectedException, MissingPermissionException;

}
